package com.bootcamp.ex1124.controller;

import com.bootcamp.ex1124.bean.BaseRespVO;
import com.bootcamp.ex1124.service.HelloService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: ex1124
 * @description:
 * @author: Keyu Li
 * @create: 2021-11-25 10:55
 **/

@RestController
@RequestMapping("hello")
public class HelloController {
    @Autowired
    HelloService helloService;

    @RequestMapping("1/{name}")
    public BaseRespVO hello1(@PathVariable("name")String name){
        String a = helloService.sayHello(name);
        return BaseRespVO.ok(a);
    }

    public HelloController() {
        System.out.println("controller 实例化");
    }
}
